{% extends "FOSUserBundle::layout.html.twig" %}
{% block head %}
{{parent()}}
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") == false %}
	<meta http-equiv="refresh" content="1; url={{path('cadss_test_homepage')}}" />
	<script type="text/javascript">
            window.location.href = "{{ path('fos_user_security_login') }}"
    </script>
{% endif %}
{% endblock head %}

{% block fos_user_content %}
	{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}	
		{% if message is defined %}
			<div class="toast">{{ message }}<img src="{{ asset('img/close.png') }}" witdh="16" height="16" onclick="this.parentNode.style.display='none'"/></div>
		{% endif %}
		<menu>
			<ul>
				<li><a>Keywords</a></li>
				<li>
					<form id="form_search" method="post" action="">
						<input type="text" class="searchfield" name="search" />
						<input type="submit" value="search" class="searchbutton" />
					</form>
				</li>
				<li><a onclick="var left = (screen.width/2)-(400/2); var top = (screen.height/2)-(400/2); window.open('{{ path('cadss_test_addkeyword') }}', '_blank', 'toolbar=No, scrollbars=No, resizable=No, fullscreen=No, top='+top+', left='+left+', width=400, height=400');">Add Keyword</a></li>
				<!--<li><a href="{{ path('cadss_test_addkeyword') }}" >Add Keyword</a></li>-->
				<li><a href="{{ path('cadss_test_homepage') }}">Manage Documents</a></li>
				<li><a href="{{ path('fos_user_security_logout') }}">{{ 'layout.logout'|trans({}, 'FOSUserBundle') }}</a></li>
			</ul>
		</menu>
		<br />
		<br />
		<div id="files">
			<table>
				<tr>
					<td width="910">Keyword</td>
					<td width="100"></td>
				</tr>
				{% for keyword in keywords %}
				<tr>
					<td>{{keyword.keyword }}</td>	
					<td>
						<a href="{{ asset('keywords/') }}{{ keyword.id }}">
							More info
						</a>
					</td>
				</tr>
				{% endfor %}
			</table>
		</div>		
    {% endif %}
{% endblock fos_user_content %}

